mini.parse();
var form = new mini.Form("#form1");
var a = [
    {"id":"0","text":"会议资料"},
    {"id":"1","text":"会议纪要"},
];
var type = mini.get("type");
// type.setData(a);

// 接收父页面传过来的值的方法
function SetData(data){
    data = mini.clone(data);       //将父页面传过来的值深克隆一下
    console.log(data.row);
    if(data.action=="edit"){      //当状态是edit的时候
        var id=data.row.id        //打点调用你获取要用的ID参数下面换成正确额得接口调用
        console.log(id);
        $.ajax({
            url: ajaxUrl+"/meetingData/findByid.do",
            type: "post",
            contentType: "application/json",
            data:boardRoom,
            success: function(data) {//请求成功完成后要执行的方法
                data = JSON.parse(data);
                form.setData(data.data);
            },
            error:function(data){
                mini.alert("cuole");
            }
        });

    }else if(data.action=="new"){

    }
}



function closeWindow(action) {            //关闭子页面
    if (window.CloseOwnerWindow)
        return window.CloseOwnerWindow(action);
    else{
        window.opener = null;
        window.open('', '_self');
        window.close();
    }

}
function onCancel(){
    closeWindow();

}
function onOk(){
    // 校验
    form.validate();
    if (form.isValid() == false) return;
    var boardRoom = form.getData();
    boardRoom = JSON.stringify(boardRoom);
    $.ajax({
        url: ajaxUrl+"/meetingData/insertData.do",
        type: "post",
        contentType: "application/json",
        data:boardRoom,
        success: function(data) {//请求成功完成后要执行的方法
            console.log(data);
        },
        error:function(data){
            mini.alert("cuole");
        }
    });
    closeWindow("ok");
}
